import Login from '../views/login'
import Registry from '../views/registry'
import CreateVote from '../views/create_vote'
import VoteList from '../views/vote_list'
import Main from '../views/main'
import Home from '../views/main/home'
import My from '../views/main/my'

export interface RouteItem{
    path:string,
    component?:any,
    redirect?:string,
    children?:RouteItem[]
}

let routes:RouteItem[] = [
    {
        path:'/main',
        component:Main,
        children:[
            {
                path:'/main/home',
                component:Home,
            },
            {
                path:'/main/my',
                component:My
            },
            {
                path:'/main',
                redirect:'/main/home'
            }
        ]
    },
    {
        path:'/login',
        component:Login
    },
    {
        path:'/registry',
        component:Registry
    },
    {
        path:'/createVote',
        component:CreateVote
    },
    {
        path:'/votelist',
        component:VoteList
    },
    {
        path:'/',
        redirect:'/main'
    }
]

export default routes